<%@ page pageEncoding="UTF-8"%>

<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>
<%@ taglib uri="/tags/struts-nested" prefix="nested"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/tags/trymore" prefix="tm"%>

<style>
	.tbl td {border-color: #797979}
	#tblprofile td.banner {line-height: 30px; font-size: 18px; font-weight: bold; text-align: center; margin: 0;}
	#tblprofile td.field {background-color: #CFDBEC; line-height: 25px; text-align: center; margin: 0; width: 100px; font-size: 9pt;}
	#tblprofile input.textInput {float:none;margin: 5px; width: 80px; height: 23px;}
</style>

<script>
	$(function(){
		$.each($("textarea", $("#tblprofile")), function(){
			$(this).html($(this).text().replace(/<br\/>/g,"\n"));
		});
	});
</script>

<table class="tbl" id="tblprofile" cellpadding="0" cellspacing="0" width="88%" border="1" style="border-collapse: collapse; border-color: #797979; margin: 0 auto;" rules="all">
	<tr>
		<td class='field'>姓名<b style="color: red; margin-left: 4px;">*</b></td>
		<td>
			<input class="textInput ${op ne null && op eq 'view' ? '' : 'required'}" id="fullName" 
				value="${entity ne null ? entity.fullName : (account ne null ? account.username : '')}" name="fullName" type="text" style="width: 90%;" <c:choose><c:when test="${op ne null && op eq 'view'}">readonly</c:when></c:choose> />
		</td>
		<td class='field'>部门</td>
		<td style="padding-left: 5px;">
			<c:choose>
				<c:when test="${op ne null && op eq 'view'}">
					${entity ne null && entity.department ne null ? entity.department.dictKey : '无'}
				</c:when>
				<c:otherwise>
					<select name="departmentId" class="combox">
						<logic:present name="dictDept">
							<logic:iterate name="dictDept" id="dict">
								<option value="${dict.id}" ${entity ne null && entity.department ne null && entity.department.id eq dict.id ? 'selected' : ''}>${dict.dictKey}</option>
							</logic:iterate>
						</logic:present>
					</select>
				</c:otherwise>
			</c:choose>
		</td>
		<td class='field'>职务</td>
		<td style="padding-left: 5px;">
			<c:choose>
				<c:when test="${op ne null && op eq 'view'}">
					${entity ne null && entity.jobTitle ne null ? entity.jobTitle.dictKey : '无'}
				</c:when>
				<c:otherwise>
					<select name="jobTitleId" class="combox">
						<logic:present name="dictDuty">
							<logic:iterate name="dictDuty" id="dict">
								<option value="${dict.id}" ${entity ne null && entity.jobTitle ne null && entity.jobTitle.id eq dict.id ? 'selected' : ''}>${dict.dictKey}</option>
							</logic:iterate>
						</logic:present>
					</select>
				</c:otherwise>
			</c:choose>
		</td>
	</tr>
	<tr>
		<td class='field'>学历</td>
		<td style="padding-left: 5px;">
			<c:choose>
				<c:when test="${op ne null && op eq 'view'}">
					${entity ne null && entity.education ne null ? entity.education.dictKey : '无'}
				</c:when>
				<c:otherwise>
					<select name="educationId" class="combox">
						<logic:present name="dictEducation">
							<logic:iterate name="dictEducation" id="dict">
								<option value="${dict.id}" ${entity ne null && entity.education ne null && entity.education.id eq dict.id ? 'selected' : ''}>${dict.dictKey}</option>
							</logic:iterate>
						</logic:present>
					</select>
				</c:otherwise>
			</c:choose>
		</td>
		<td class='field'>毕业院校</td>
		<td>
			<input name="school" class="textInput" value="${entity ne null ? entity.school : ''}" type="text" 
				style="width: ${op ne null && op eq 'view' ? '90' : '95'}%;" ${op ne null && op eq 'view' ? 'readonly' : ''}/>
		</td>
		<td class='field'>专业</td>
		<td>
			<input name="majority" class="textInput" value="${entity ne null ? entity.majority : ''}" type="text" 
				style="width: 90%;" ${op ne null && op eq 'view' ? 'readonly' : ''}/>
		</td>
	</tr>
	<tr>
		<td class='field'>联系方式</td>
		<td>
			<input name="mobilePhone" class="textInput" value="${entity ne null ? entity.mobilePhone : (account ne null ? account.userPhoneNumber : '')}" type="text" 
				style="width: 90%;" ${op ne null && op eq 'view' ? 'readonly' : ''}/>
		</td>
		<td class='field'>邮箱</td>
		<td colspan="3">
			<input name="email" class="textInput email" value="${entity ne null ? entity.email : (account ne null ? account.userMail : '')}" type="text" 
				style="width: 96%;" ${op ne null && op eq 'view' ? 'readonly' : ''}/>
		</td>
	</tr>
	<tr>
		<td class='field'>个人简介</td>
		<td colspan="5">
			<textarea name="introduction" rows="2" style="width: 98%; height: 420px; margin: 5px;" ${op ne null && op eq 'view' ? 'readonly' : ''}>${entity ne null ? entity.introduction : ''}</textarea>
		</td>
	</tr>
	
	<input type="hidden" name="id" value="${entity ne null ? entity.id : -1}" />
	<input type="hidden" name="uid" value="${account ne null ? account.id : -1}" />
</table>